<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var txuPrice=245;
			var txuCount=2;
			var shoePrice=570;
			var shoeCount=10;
			var paiPrice=320;
			var paiCount=1;
			var discount=0.8;
			var userMoney=5300;
			
			document.write("<table width='300',align='center'>");
			document.write("<tr>");
			document.write("<td colspan='4',align='center'>");
			document.write("******消费单*******");
			document.write("</td>");
			document.write("</tr>");
			
			document.write("<tr><td>购买物品</td>");
			document.write("<td>单价</td>");
			document.write("<td>数量</td>");
			document.write("<td>金额</td>");
			document.write("</tr>");
						
			document.write("<tr><td>T恤</td>");
			document.write("<td>&yen;"+txuPrice+"</td>");
			document.write("<td>"+txuCount+"</td>");
			document.write("<td>&yen;"+(txuCount*txuPrice)+"</td>");
			document.write("</tr>");
			
			document.write("<tr><td>网球鞋</td>");
			document.write("<td>&yen;"+shoePrice+"</td>");
			document.write("<td>"+shoeCount+"</td>");
			document.write("<td>&yen;"+(shoePrice*shoeCount)+"</td>");
			document.write("</tr>");
			
			document.write("<tr><td>网球拍</td>");
			document.write("<td>&yen;"+paiPrice+"</td>");
			document.write("<td>"+paiCount+"</td>");
			document.write("<td>&yen;"+(paiPrice*paiCount)+"</td>");
			document.write("</tr>");
			
			document.write("<tr>");
			document.write("<td colspan='4'align='center'> ");
			document.write("&nbsp;");
			document.write("</td>");
			document.write("</tr>");
			
			document.write("<tr><td>折扣：</td>");
			document.write("<td colspan='3'>"+(discount*10)+"折</td>");
			document.write("</tr>");
			
			document.write("<tr><td>消费总金额：</td>");
			document.write("<td colspan='3'>");
			var totalPrice=txuCount*txuPrice+shoePrice*shoeCount+paiPrice*paiCount;
			document.write("&yen;"+totalPrice*discount);
			document.write("</td>");
			document.write("</tr>");
			
			document.write("<tr><td>实际交费：</td>");
			document.write("<td colspan='3'>"+userMoney+"</td>");
			document.write("</tr>");
			
			document.write("<tr><td>找零：</td>");
			document.write("<td colspan='3'>&yen;"+(userMoney-totalPrice*discount)+"</td>");
			document.write("<tr></tr>");
			
			document.write("</table>");
		</script>
	</body>
</html>
